<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<?php
include_once('connection/connection.php');
include('config.php');
$form_id=trim($_REQUEST['form_id']);
$sqlSWS="select * from tbl_dtls_q1_sws where loc_id=".$form_id;
//echo $sqlSWS;
$querySWS=mysql_query($sqlSWS);
//$rowSWS=mysql_fetch_array($querySWS);
?> 
<table border="0" width="800" id="table4" cellspacing="1" cellpadding="0" bgcolor="#EEEEEE">
				<tr>
					<td colspan="6"><span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				
				<tr>
				<td align="center" width="190" bgcolor="#CCCCCC">
						<font face="Verdana" style="font-size: 8.5pt" color="#990000">Source</font></td>
					<td align="center" width="174" bgcolor="#CCCCCC">
                        <font face="Verdana" style="font-size: 8.5pt" color="#990000">Current Status</font>
                        </td>
						
					<td align="center" width="74" bgcolor="#CCCCCC">
						<font style="font-size: 8.5pt" face="Verdana" color="#990000">
						Yield (Min) KL/day</font></td>
					<td align="center" width="92" bgcolor="#CCCCCC">
						<font face="Verdana" style="font-size: 8.5pt" color="#990000">
						Yield (Max) KL/day</font></td>
					<td align="center" width="120" bgcolor="#CCCCCC">
						<font face="Verdana" style="font-size: 8.5pt" color="#990000">Water Table (Min) (M)</font></td>
					<td align="center" width="143" bgcolor="#CCCCCC">
						<font style="font-size: 8.5pt" face="Verdana" color="#990000">Water Table (Max) (M)</font></td>
				</tr>	
				<?php
//$no=$_POST['num_source'];
//for($i=1; $i<=$no; $i++)
//{
  $i=1;
	while($rowSWS=mysql_fetch_array($querySWS)){
?>
				<tr>
				<td width="190" align="center"><font style="font-size: 8.5pt" face="Verdana" color="#000000">
						<select size="1" name="source<?php echo $i;?>" id="source<?php echo $i;?>" class="txt">
						<option selected value="0">Select</option>
						<?php 
						foreach($sources as $key=>$val)
						{
							if($rowSWS['source']==$val)
							{
		   						echo "<option value=$val selected>$val</option>";
							}
							else
							{
								echo "<option value=$val>$val</option>";
							}
								
						}
						?>
				  </select></font></td>
				  <td width="174" height="20">
                  <font color="#000000" size="2">
                  <input type="radio" name="current_status<?php echo $i;?>" id="current_status<?php echo $i;?>" value="operation" <?php echo ($rowSWS['current_status']=='operation')?'checked':'';?> onClick="setEnable22(this.value,<?php echo $i; ?>)"> Operatioanl
				  <input type="radio" name="current_status<?php echo $i;?>" id="current_status<?php echo $i;?>" value="defunct" <?php echo ($rowSWS['current_status']=='defunct')?'checked':'';?> onClick="setReadOnly22(this.value,<?php echo $i; ?>)">Defunct
				  </font>
                  </td>
				 <?php if($rowSWS['current_status']=='defunct') { ?> 
					<td width="74" align="center">
				  <input type="text" name="yield_min<?php echo $i;?>" id="yield_min<?php echo $i;?>" size="10" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['yield_min'];?>" disabled></td>
					<td width="92" align="center">
				  <input type="text" name="yield_max<?php echo $i;?>" id="yield_max<?php echo $i;?>" size="10" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['yield_max'];?>" disabled></td>
					<td width="120" align="center">
				  <input type="text" name="water_table_min<?php echo $i;?>" id="water_table_min<?php echo $i;?>" size="15" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['water_table_min'];?>" disabled></td>
					<td width="143" align="center">
				  <input type="text" name="water_table_max<?php echo $i;?>" id="water_table_max<?php echo $i;?>" size="15" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['water_table_max'];?>" disabled ></td>
				  <?php }
				  else {
				  ?>
				  <td width="74" align="center">
				  <input type="text" name="yield_min<?php echo $i;?>" id="yield_min<?php echo $i;?>" size="10" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['yield_min'];?>" ></td>
					<td width="92" align="center">
				  <input type="text" name="yield_max<?php echo $i;?>" id="yield_max<?php echo $i;?>" size="10" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['yield_max'];?>" ></td>
					<td width="120" align="center">
				  <input type="text" name="water_table_min<?php echo $i;?>" id="water_table_min<?php echo $i;?>" size="15" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['water_table_min'];?>" ></td>
					<td width="143" align="center">
				  <input type="text" name="water_table_max<?php echo $i;?>" id="water_table_max<?php echo $i;?>" size="15" class="txt5" onblur="float(this)" value="<?php echo $rowSWS['water_table_max'];?>" ></td>
				  <?php } ?>
				  <input type="hidden" name="sourcecount" id="sourcecount" value="<?php echo $no;?>"/>	
				</tr>
				<?php $i++;
						} 
				?>						
</table>






